﻿using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Testudo.WebApp.Events;

public class NotifyCommand : NotifyEvent
{
    public NotifyCommand()
    {
        Type = NotifyType.Command;
    }

    public CommandBase Cmd { get; init; }
    // todo:
}



public abstract class CommandBase
{
    public CommandType Type { get; init; }
    public Guid ScenarioId { get; init; }
    public string Message { get; init; }
}

[JsonConverter(typeof(StringEnumConverter))]
public enum CommandType
{
    Load = 1,
    Unload,
    Start,
    Stop
}

public class CommandLoad : CommandBase
{
    public CommandLoad()
    {
        Type = CommandType.Load;
    }
}

public class CommandUnload : CommandBase
{
    public CommandUnload()
    {
        Type = CommandType.Unload;
    }
}

public class CommandStart : CommandBase
{
    public CommandStart()
    {
        Type = CommandType.Start;
    }
}

public class CommandStop : CommandBase
{
    public CommandStop()
    {
        Type = CommandType.Stop;
    }
}